package com.dfbz.demo01_类加载器;

import com.sun.java.accessibility.AccessBridge;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_获取类加载器 {
    public static void main(String[] args) {


        // 获取这个类的类加载器(BootstrapClassLoader在Java中不可以获取到)
        ClassLoader bootStrapClassLoader = Object.class.getClassLoader();

        ClassLoader extClassLoader = AccessBridge.class.getClassLoader();

        ClassLoader appClassLoader = Demo01_获取类加载器.class.getClassLoader();

        System.out.println(bootStrapClassLoader);           // null
        System.out.println(extClassLoader);                 // sun.misc.Launcher$ExtClassLoader@45ee12a7
        System.out.println(appClassLoader);                 // sun.misc.Launcher$AppClassLoader@18b4aac2
    }
}
